import 'lib-flexible';

import React from 'react';
import ReactDOM from 'react-dom';

import {Switch,Route, Redirect} from 'react-router-dom';
import {Provider} from 'react-redux';
import {store, persistor} from './store/index';
import {ConfigProvider} from 'antd';
import zh_CN from "antd/lib/locale-provider/zh_CN";//国际化中文
import '@/assets/css/common.less';
import Tabs from "./components/Tabs";//引入底部的页签导航
import Home from './routers/Home';
import Mine from './routers/mine';
import Profile from './routers/Profile';
import {ConnectedRouter} from 'connected-react-router';
import history from './store/history';
import Register from "./routers/Register";
import Login from "./routers/Login";
import Detail from './routes/Detail'
import Cart from './routes/Cart'
import { PersistGate } from 'redux-persist/es/integration/react'


ReactDOM.render(
    <Provider store={store}>
        <ConnectedRouter history={history}>
            <ConfigProvider>
                <main className='main-container'>
                    <Switch>
                        <Route exact path='/' component={Home}></Route>
                        <Route path='/mine' component={Mine}></Route>
                        <Route path='/Profile' component={Profile}></Route>
                        <Route path="/register" component={Register} />
                        <Route path="/login" component={Login} />
                        <Route path="/detail/:id" exact component={Detail}/>
                        <Route path="/cart" exact component={Cart}/>
                        <Redirect to="/"/>
                    </Switch>
                </main>
                <Tabs></Tabs>
            </ConfigProvider>
        </ConnectedRouter>
    </Provider>,
    document.getElementById('root'))
;